package com.alan.mapper;

import com.alan.entity.Schedule;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ScheduleMapper {

    @Select("SELECT * FROM `schedule` where listId = #{listId} and userId = #{userId}")
    Schedule getScheduleByUserIdAndListId(Integer listId,Integer userId);

    @Update("UPDATE `schedule` SET learned = #{learned},ndtolearn = #{ndtolearn} WHERE userId = #{userId} AND listId = #{listId};")
    int updateById(Integer userId, Integer listId, Integer learned, Integer ndtolearn);
}
